using System.Collections.ObjectModel;
using Caliburn.Micro;

namespace CitiSurface
{
    public class MainBarAlbum : PropertyChangedBase, IMainBarItem
    {
        public string Name { get; set; }
        public string Brief { get; set; }
        public string ScreenshotSource { get; set; }
        private readonly ObservableCollection<string> _imageSources = new ObservableCollection<string>();
        public ObservableCollection<string> ImageSources { get { return _imageSources; } } 

        public MainBarAlbum() {}

        public MainBarAlbum(string name, string brief, string screenshotSource)
        {
            Name = name;
            Brief = brief;
            ScreenshotSource = screenshotSource;
            AddImage(screenshotSource); // automatically add screenshot image
        }

        public void AddImage(string imageSource)
        {
            _imageSources.Add(imageSource);
        }

        public object Clone()
        {
            var copyObj = new MainBarAlbum {Name = Name, Brief = Brief, ScreenshotSource = ScreenshotSource};
            foreach(var source in _imageSources)
            {
                copyObj.AddImage(source);
            }
            return copyObj;
        }
    }
}
